const success = (data = '') =>
{
	if(data instanceof Object)
	{
		uni.showToast({
			...data
		})
	}else
	{
		uni.showToast({
			icon: 'success',
			title: data,
			duration: 2000
		})
	}
	
}


const error = (data = '') =>
{
	if(data instanceof Object)
	{
		uni.showToast({
			icon: 'error',
			...data
		})
	}else
	{
		uni.showToast({
			icon: 'error',
			title: data,
			duration: 2000
		})
	}
	
}

const business = uni.getStorageSync('business') ? uni.getStorageSync('business') : {}

export default {
	install(Vue)
	{
		Vue.config.globalProperties.$success = success
		Vue.config.globalProperties.$error = error
        Vue.config.globalProperties.$business = ref(business)
	}
}